from qfluentwidgets import FluentIcon
import sys


def list_available_icons():
    """列出所有可用的FluentIcon图标"""
    icons = []
    for name in dir(FluentIcon):
        if not name.startswith('_') and name.isupper():
            icons.append(name)

    return sorted(icons)


if __name__ == "__main__":
    try:
        icons = list_available_icons()
        print("可用的FluentIcon图标:")
        for i, icon in enumerate(icons, 1):
            print(f"{i}. {icon}")
        print(f"总共 {len(icons)} 个图标")

        # 检查常用图标是否存在
        common_icons = ['APP', 'DESKTOP', 'SYNC',
                        'REFRESH', 'MINIMIZE', 'CLOSE']
        print("\n检查常用图标是否可用:")
        for icon_name in common_icons:
            if hasattr(FluentIcon, icon_name):
                print(f"✅ {icon_name} 可用")
            else:
                print(f"❌ {icon_name} 不可用")
    except Exception as e:
        print(f"获取图标列表时出错: {e}")
